/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package DB;

import java.beans.Statement;
import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;


/**
 *
 * @author Dan dotcom
 */
public class Db {
    Connection c = null;
    boolean ok=true;
    public Db() {
        String fDB = "AgroSmart.db";
        File fichero = new File(fDB);
        try {
            Class.forName("org.sqlite.JDBC");
            if(fichero.exists()){
                c = DriverManager.getConnection("jdbc:sqlite:AgroSmart.db");
            }
            //c = DriverManager.getConnection("jdbc:sqlite:usuarios.db");
            c.setAutoCommit(false);
            
        } catch (Exception e){
            ok=false;
        }
    if(ok==true){
        System.out.println("Opened database successfully");
    }
    }
    public void hor(){}
    
}
